<?php
	$server = new swoole_server('172.16.41.183', 9000);

	//监听连接进入事件
	$server->on('connect', function($serv, $fd) {
		echo "Cline: Connet.\n";
	});

	//监听数据接收接收事件
	$server->on('receive', function ($serv, $fd, $from_id, $data) {
		$serv->send($fd, "Server: ".$data);
	});

	//监听连接关闭事件
	$server->on('close', function ($serv, $fd) {
		echo "Client: Close.\n";
	});

	//启动服务器
	$server->start();
?>